﻿using eLongLoginTest.com.elong.gaia.agent.Air_Search;

namespace eLongLoginTest.Air_Search_Helper
{
    /// <summary>
    /// 继承原有的WEBSERVICE的AIR_SEARCH，封装FLIGHTSEARCH方法为更友好的调用接口，隐藏COOKIE等细节
    /// </summary>
    class FlightSearcher : Air_Search
    {
       
        /// <summary>
        /// 一个Searcher
        /// </summary>
        /// <param name="RequestBody">请求BODY实体</param>
        /// <returns>应答BODY实体</returns>
        public FlightSearchResponseBody SendRequestAndGetResponse(FlightSearchRequestBody RequestBody)
        {
            FlightSearchResponseBody ResponseBody=new FlightSearchResponseBody();
            
            Air_Search air_searcher = new Air_Search();
            air_searcher.CookieContainer = Globals.Globals.cookie;
            
            string result_tmp=air_searcher.FlightsSearch(RequestBody.ToXml());
            ResponseBody.DeSerialize(result_tmp);

            return ResponseBody;
        }
    }
}
